package directmemory;

import java.io.IOException;
import java.nio.ByteBuffer;

/**
 * @author ZhengDp
 * @Date 2023/5/12 22:35
 */
public class DirectMemory_Demo2 {
    static int _1Gb = 1024*1024*1024;

    public static void main(String[] args) throws IOException {
        ByteBuffer byteBuffer = ByteBuffer.allocateDirect(_1Gb);
        System.out.println("分配完毕...");
        System.in.read();
        System.out.println("开始释放 ...");
        byteBuffer = null;
        System.gc();
        System.in.read();
    }
}
